package com.AndroidUI;

import com.AR_Edificacio.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ChannelElement extends LinearLayout {
	
	private int channelID = 0;
	private String channelName = "Channel " + channelID;

	public ChannelElement(Context context) {
		super(context);
	}
	
	public void initialize(int id, String name) {
		this.channelID = id;
		this.channelName = name;
		
		initializeLayoutBasics(getContext());
		setNameLabel();
	}
	
    private void initializeLayoutBasics(Context context) {
        setOrientation(HORIZONTAL);
        final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.channel_element, this);
    }
    
    private void setNameLabel() {
    	TextView labelName = (TextView) findViewById(R.id.channel_name);
    	labelName.setText(channelName);
    }
       
    

}
